import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
    //引入error路由
import ErrorRoute from '@/views/errors/router'
import GuideRoute from '@/views/guide/router'
import HomeRoute from '@/views/home/router'
import StartRoute from '@/views/start/router'
import ClassifyRoute from '@/views/classify/router'
import CityRoute from '@/views/city/router'
import DetailedRoute from '@/views/detailed/router'
import SearchRoute from '@/views/search/router'
import LikeRoute from '@/views/like/router'
import PlaceRoute from '@/views/place/router'
import PayloadRoute from '@/views/payload/router'

const routes = [{
        path: "/",
        redirect: "/guide"
    },
    ...ErrorRoute,
    ...GuideRoute,
    ...HomeRoute,
    ...StartRoute,
    ...ClassifyRoute,
    ...CityRoute,
    ...DetailedRoute,
    ...SearchRoute,
    ...LikeRoute,
    ...PlaceRoute,
    ...PayloadRoute,
    {
        path: "*",
        redirect: "/404"
    },



]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router